package com.ansion.basedb.dao.helper;

import androidx.annotation.NonNull;

import com.ansion.basedb.dao.model.ContactsModel;
import com.ansion.basedb.dao.model.UserModel;
import com.ansion.basedb.database.sql.SQLRow;
import com.ansion.basedb.database.sql.SqlEntityWrapper;

/***
 * 用于升级创建FtsUser索引，需要对UserModel和ContactsModel做联表查询
 */
class UserQueryBeanForUI extends SqlEntityWrapper {
    private String userId;
    private long updateTime;
    private String nickName;
    private String firstName;
    private String middleName;
    private String lastName;
    private int contactId;


    public UserQueryBeanForUI() {

    }


    @Override
    public void readFromSQLRow(@NonNull SQLRow row) {
        userId = row.getAsString(UserModel.kColumnName_UserId);
        updateTime = row.getAsLong(UserModel.kColumnName_UpdateTime);
        nickName = row.getAsString(UserModel.kColumnName_NickName);
        firstName = row.getAsString(ContactsModel.kColumnName_FirstName);
        middleName = row.getAsString(ContactsModel.kColumnName_MiddleName);
        lastName = row.getAsString(ContactsModel.kColumnName_LastName);
        contactId = row.getAsInteger(ContactsModel.kColumnName_ContactId);
    }

    public String getUserId() {
        return userId;
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public String getNickName() {
        return nickName;
    }

    public String getFirstName() {
        return firstName;
    }

    public String getMiddleName() {
        return middleName;
    }

    public String getLastName() {
        return lastName;
    }

    public int getContactId() {
        return contactId;
    }
}
